xen/arm: create a cpuinfo structure for guest
authorBertrand Marquis <bertrand.marquis@arm.com>
Thu, 17 Dec 2020 15:38:04 +0000 (15:38 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 4 Jan 2021 19:25:03 +0000 (11:25 -0800)
commit3669a1cb95983dc1c01be46e7df5dd9357d7b973
tree392a03a5cff2c9db92fc41e8de7716f2037ded83
parent2d66a1f095f716e4bf7e47d61e1d1de13e99167a
xen/arm: create a cpuinfo structure for guest

Create a cpuinfo structure for guest and mask into it the features that
we do not support in Xen or that we do not want to publish to guests.

Modify some values in the cpuinfo structure for guests to mask some
features which we do not want to allow to guests (like AMU) or we do not
support (like SVE).
Modify some values in the guest cpuinfo structure to guests to hide some
processor features:
- SVE as this is not supported by Xen and guest are not allowed to use
this features (ZEN is set to 0 in CPTR_EL2).
- AMU as HCPTR_TAM is set in CPTR_EL2 so AMU cannot be used by guests
All other bits are left untouched.
- RAS as this is not supported by Xen.

The code is trying to group together registers modifications for the
same feature to be able in the long term to easily enable/disable a
feature depending on user parameters or add other registers modification
in the same place (like enabling/disabling HCR bits).

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/cpufeature.c
xen/include/asm-arm/cpufeature.h